home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Format 1997 January
/
macformat46.iso
/
File Maker Pro 3.0 Tutorial
/
File Maker Pro 3.0
/
Templates
/
FileMaker And Apple Events
/
Sample Applications
/
Relational Data
/
Get Related Data
next >
Wrap
Text File
|
1996-06-05
|
1KB
|
38 lines
-- one line examples
tell application "FileMaker Pro"
tell database "Master File"
record 1 -- get entire record including portal
cell "Related File::Product ID" -- get related cell by name
cell 2 -- get related cell by number
cell ID {1, {1, 2}} -- get related cell by ID
field "Related File::Product ID" -- get related field by name
field 2 -- get related field by number
field ID {1, 2} -- get related field by ID
every field whose name contains "::" -- get all related fields from a layout
end tell
end tell
getRelationshipsfromFieldNames()
--this routine returns the name of every relationship based on all related fields on the current layout
--note that you can get the name of the related file is the relationship name is the same as the related file
on getRelationshipsfromFieldNames()
tell application "FileMaker Pro"
set relationshipNames to {}
tell database "Master File"
--create a list of the names of all related fields
set relatedFields to name of every field whose name contains "::"
--extract the name of the related file from each related field
repeat with fieldName in relatedFields
set relationshipNames to relationshipNames & (characters 1 thru ((offset of "::" in fieldName) - 1) of fieldName as string)
end repeat
--return the list of related file names
return relationshipNames
end tell
end tell
end getRelationshipsfromFieldNames